package com.authine.cloudpivot.ext.dto.model.invoice;

import com.authine.cloudpivot.ext.enums.order.OrderGoodsStatusEnum;
import com.authine.mvp.app.launcher.domain.SelectorFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Builder
@Schema(description = "可申请开票数据明细")
public class ApplyInvoiceDetailDto {

    /**
     * 因为服务费发票是以账单维度申请，所以服务费发票的时候赋值账单ID
     * 货物发票是交易ID
     */
    @Schema(description = "服务费发票是账单ID，货物发票是交易ID")
    private String id;

    @Schema(description = "目标组织ID")
    private SelectorFormat organization_id;

    @Schema(description = "erp_po")
    private String erp_po;

    @Schema(description = "方向", required = true)
    private String direction;

    @Schema(description = "业务类型,枚举类 TradeOrderType", required = true)
    private String business_type;

    @Schema(description = "订单商品ID", required = true)
    private String order_goods_id;

    /**
     * 单价（含税）
     */
    @Schema(description = "单价（含税）")
    private BigDecimal price;

    @Schema(description = "申请数量")
    private BigDecimal quantity;


    @Schema(description = "商品税率")
    private BigDecimal tax_rate;

    /**
     * 单价（未税）
     */
    @Schema(description = "未税单价")
    private BigDecimal pretax_price;

    /**
     * 未税商品总金额
     */
    @Schema(description = "未税商品总金额")
    private BigDecimal amount;

    /**
     * 含税商品总金额
     */
    @Schema(description = "含税商品总金额")
    private BigDecimal total;

    @Schema(description = "税额")
    private BigDecimal tax;

    @Schema(description = "供应商订单ID")
    private String vendor_order_id;

    @Schema(description = "客户订单ID")
    private String customer_order_id;

    @Schema(description = "金税编码")
    private String golden_tax;

    @Schema(description = "订单商品状态,")
    private OrderGoodsStatusEnum order_goods_status;


    @Schema(description = "可申请开票数量")
    private BigDecimal allowed_invoice_quantity;

    @Schema(description = "可申请开票金额(含税)")
    private BigDecimal allowed_invoice_total;

    @Schema(description = "本次申请数量")
    private BigDecimal apply_number;

    @Schema(description = "单位")
    private String unit;

    @Schema(description = "品名")
    private String name;
    @Schema(description = "品牌-规格")
    private String model_spec;
    @Schema(description = "是否小规模")
    private Boolean small_scale;
}
